package com.su.lesson05;

import javax.swing.*;
import java.awt.*;

public class JPanelDemo extends JFrame {
    public JPanelDemo(){
        Container container =getContentPane();

        container.setLayout(new GridLayout(1,2,10,10));

        JPanel panel= new JPanel();
        panel.setLayout(new GridLayout(1,3));
        panel.add(new JButton("Button 1"));
        panel.add(new JButton("Button 2"));
        panel.add(new JButton("Button 3"));

        JPanel panel2 = new JPanel();
        panel2.setLayout(new GridLayout(1,2));
        panel2.add(new JButton("Button 4"));
        panel2.add(new JButton("Button 5"));

        container.add(panel2);
        container.add(panel);
        setBounds(100, 100, 450, 300);
        setVisible(true);
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    }

    public static void main(String[] args) {
        new JPanelDemo();
    }
}
